package com.cxhome.cxinfox.cxmenu;

import java.util.List;

import org.apache.log4j.Logger;

import com.traffic.managent.base.BaseService;
import com.traffic.managent.model.system.Systems;

/**
 * 系统处理类
 */
public class SystemsService extends BaseService {

	private final static Logger log = Logger.getLogger(SystemsService.class);

	/**
	 * 供应商复选框
	 * 
	 * @return
	 */
	public String selectSystems(String selected) {

		List<Systems> list = Systems.dao.find(" select ids,names from cx_systems where 1=1 ");

		StringBuffer sb = new StringBuffer("");

		if (list != null && list.size() > 0) {
			for (Systems providerinfo : list) {
				sb.append("<option value=\"");
				sb.append(providerinfo.getStr("ids"));
				sb.append("\" ");
				sb.append((selected != null && providerinfo.getStr("ids").equals(selected)) ? "selected" : "");
				sb.append(">");
				sb.append(providerinfo.getStr("names"));
				sb.append("</option>");
			}
		}
		return sb.toString();
	}
}
